package cn.kgc.controller;

import cn.kgc.dto.Dto;
import cn.kgc.service.ItemService;
import org.springframework.web.bind.annotation.RequestParam;


import cn.kgc.vo.ItemDetailVo;
import cn.kgc.vo.ItemPriceVo;
import cn.kgc.vo.ItemSchedulerVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import  java.util.*;
@RestController
@RequestMapping("/api")
public class ItemController {

    @Autowired
    ItemService itemService;

    @RequestMapping("/p/queryItemDetail")
    public Dto<ItemDetailVo> QueryItemDetail(@RequestParam Integer id) throws Exception {
        return itemService.quaryItemDetail(id);
    }

    @RequestMapping("/p/queryItemScheduler")
    public Dto<ItemSchedulerVo> queryItemScheduler(@RequestParam  Integer itemId) throws Exception {
        return itemService.queryItemScheduler(itemId);
    }


    @RequestMapping("/p/queryItemPrice")
    public Dto<List<ItemPriceVo>> queryItemPrice(@RequestParam Integer schedulerId) throws Exception {
        return itemService.queryItemPrice(schedulerId);
    }



}
